"""
自定义异常类
"""


class ERPMockException(Exception):
    """ERP Mock基础异常"""
    def __init__(self, message: str, code: str = "500"):
        self.message = message
        self.code = code
        super().__init__(self.message)


class ValidationError(ERPMockException):
    """数据验证异常"""
    def __init__(self, message: str):
        super().__init__(message, code="400")


class AuthenticationError(ERPMockException):
    """认证异常"""
    def __init__(self, message: str):
        super().__init__(message, code="401")


class ResourceNotFoundError(ERPMockException):
    """资源不存在异常"""
    def __init__(self, message: str):
        super().__init__(message, code="404")


class BusinessError(ERPMockException):
    """业务逻辑异常"""
    def __init__(self, message: str, code: str = "500"):
        super().__init__(message, code)
